var events = require("events");
var emitter = new events.EventEmitter();

var handler = function(){
    console.log("有状况!");
};

emitter
.on('something-happen', handler)
.emit('something-happen');